<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" import="org.swim.web.utils.*"%>

<!DOCTYPE html>
<html lang="en">
<head>
<%@include file="include/header.jsp"%>
<title><%=SwimConst.getTitle()%></title>
</head>
<body>
	<%@include file="include/navbar.jsp"%>
	<%@include file="include/error-handling.jsp"%>

	<!-- Start Documentation Links -->
	<div id="documentationLinks" class="modal hide fade" tabindex="-1"
		role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-header">
			<h3 id="myModalLabel">SWIMv2 Documentation</h3>
		</div>
		<div class="modal-body">
			<table class="table table-striped">
				<tr>
					<td style="border-top: 0px"><a
						href="https://docs.google.com/document/d/103jNa4YsbtHVLYnQXZvaB8CdJr3C3LdYZ0TyuRocO6I/edit"
						target="_blank"><i class="icon-calendar"></i> Project planning</a></td>
				</tr>
				<tr>
					<td><a
						href="https://docs.google.com/document/d/1UinV-tiw5u2R3T-xBukLFmcTVFPvKEQ0HDbyiiQG9oM/edit"
						target="_blank"><i class="icon-th-list"></i> Requirements analysis and
							specification</a></td>
				</tr>
				<tr>
					<td><a
						href="https://docs.google.com/document/d/1PvTo1T5tUS3P5xfO_q4A1ySyw1NgV0rZJ7KU-zTANPQ/edit"
						target="_blank"><i class="icon-th-large"></i> Design</a></td>
				</tr>
				<tr>
					<td><a
						href="https://docs.google.com/document/d/1rdrRQqGJC5xMcdUwyajwbNXTdbYkiDd3EtzghgXDu3c/edit"
						target="_blank"><i class="icon-book"></i> User manual</a></td>
				</tr>
				<tr>
					<td><a
						href="https://docs.google.com/document/d/1gZqTzcZ5dgRIvZk_c-WWpdCOVDLwJI6ANzO7w6PRLWQ/edit"
						target="_blank"><i class="icon-download-alt"></i> Installation manual</a></td>
				</tr>
				<tr>
					<td><a
						href="https://docs.google.com/document/d/1J8syYT2FSymkoUX_CP-95_ecrFhz0rmbE57TEccWUYQ/edit"
						target="_blank"><i class="icon-wrench"></i> Testing cases</a></td>
				</tr>
				
				<tr>
					<td><a
						href="https://docs.google.com/document/d/160Gbd6yfMEFoHkNNg9mvIt0WImz6qmoMcGRgavlyxZg/edit"
						target="_blank"><i class="icon-repeat"></i> RASD and DD correction</a></td>
				</tr>
			</table>

		</div>
		<div class="modal-footer">
			<button class="btn btn-info" data-dismiss="modal" aria-hidden="true">Close</button>
		</div>
	</div>
	<!-- End Documentation Links -->


	<div class="container">
		<div class="hero-unit">
			<img src="<%=SwimConst.Url.WEBCONTENT%>/img/logo/300x148.png"
				class="pull-right" />
			<h1>Swim 2.0</h1>
			<p>right person for right job</p>
			<p>
				<a href="javascript: $('#documentationLinks').modal('show');"
					class="btn btn-primary btn-large"> Learn more </a>
			</p>
		</div>
		<div class="row">
			<div class="span6">
				<div class="ui-corner-all" style="background: #fff; padding: 10px;">
					<h3>Sign Up</h3>
					<form method="post"
						action="<%=SwimConst.Url.Servlet.PROFILE%>?a=<%=Action.SIGNUP.name().toLowerCase()%>">
						<%
							String name = "";
							String surname = "";
							String email = "";
							String checkEmail = "";

							if (request.getAttribute(ErrorHandling.SERVLET_ACTION) == Action.SIGNUP
									&& request
											.getAttribute(ErrorHandling.SERVER_EXCEPTION_SEVERITY) == Severity.WARNING) {
								name = (request.getParameter(ProfileAttr.UserAttr.NAME) != null) ? request
										.getParameter(ProfileAttr.UserAttr.NAME) : "";
								surname = (request.getParameter(ProfileAttr.UserAttr.SURNAME) != null) ? request
										.getParameter(ProfileAttr.UserAttr.SURNAME) : "";
								email = (request.getParameter(ProfileAttr.UserAttr.EMAIL) != null) ? request
										.getParameter(ProfileAttr.UserAttr.EMAIL) : "";
								checkEmail = (request
										.getParameter(ProfileAttr.UserAttr.EMAIL_CHECK) != null) ? request
										.getParameter(ProfileAttr.UserAttr.EMAIL_CHECK) : "";
							}
						%>
						<div class="controls controls-row">
							<input name="<%=ProfileAttr.UserAttr.NAME%>" class="span2"
								type="text" placeholder="Name" value="<%=name%>" required>
							<input name="<%=ProfileAttr.UserAttr.SURNAME%>" class="span2"
								type="text" placeholder="Surname" value="<%=surname%>" required>
						</div>
						<div class="controls">
							<input autocomplete="off" name="<%=ProfileAttr.UserAttr.EMAIL%>"
								value="<%=email%>" class="span4" type="email"
								placeholder="Your email" required> <input
								name="<%=ProfileAttr.UserAttr.EMAIL_CHECK%>"
								value="<%=checkEmail%>" class="span4" type="email"
								placeholder="Re-enter your email" required autocomplete="off">
						</div>
						<div class="controls controls-row">
							<input name="<%=ProfileAttr.UserAttr.PASSWORD%>" class="span3"
								type="password" placeholder="Password" required>
						</div>
						<div class="controlscontrols-row">
							<button class="btn btn-primary" type="submit">Sign Up</button>
						</div>
					</form>
				</div>
			</div>
			<div class="span6">
				<div class="ui-corner-all" style="background: #fff; padding: 10px;">
					<h3>Sign In</h3>
					<form method="post"
						action="<%=SwimConst.Url.Servlet.PROFILE%>?a=<%=Action.SIGNIN.name().toLowerCase()%>">
						<div class="controls controls-row">
							<input name="<%=CollaborationAttr.SignInAttr.EMAIL%>"
								class="span4" type="email" placeholder="Your email" required>
						</div>
						<div class="controls">
							<input name="<%=CollaborationAttr.SignInAttr.PASSWORD%>"
								class="span4" type="password" placeholder="Password" required>
						</div>
						<div class="controls controls-row">
							<button class="btn btn-primary" type="submit">Sign In</button>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
	<%@include file="include/footer.jsp"%>
	<%@include file="include/script-common.jsp"%>
</body>
</html>